<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="物流状态" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="search-bar wrapper-none col-xs-12">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                                ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')">高级搜索</button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="物流运单号" ng-model="condition.wayBillNo">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)" reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">客户名称：</label>
                        <input type="text" class="form-control" placeholder="客户名称" ng-model="condition.dealerOrgName">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">物流状态：</label>
                        <select class="form-control" ng-model="condition.logisticStatus">
                            <option value="">请选择</option>
                            <option value=1>已发货</option>
                            <option value=2>运输中</option>
                            <option value=3>已到货</option>
                            <option value=4>已签收</option>
                        </select>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">单据类型：</label>
                        <select class="form-control" ng-model="condition.businessType">
                            <option value="">请选择</option>
                            <option value="XGFJ">发运交接单</option>
                            <option value="XGSC">三包出库单</option>
                        </select>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label">制单时间：</label>
                        <input type="text" class="form-control date-picker" ng-model="condition.createDateStart"
                               datepicker-popup="{{'yyyy-MM-dd'}}"
                               ng-click="showDateStart = !showDateStart"
                               ng-change="checkDate(condition, 'createDateStart', 'createDateEnd')"
                               is-open="showDateStart" close-text="关闭" modal-size="small" readonly>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"></label>
                        <label class="control-label wave-line">~</label>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"></label>
                        <input type="text" class="form-control date-picker" ng-model="condition.createDateEnd"
                               datepicker-popup="{{'yyyy-MM-dd'}}"
                               ng-click="showDateEnd = !showDateEnd"
                               ng-change="checkDate(condition, 'createDateStart', 'createDateEnd')"
                               is-open="showDateEnd" close-text="关闭" modal-size="small" readonly>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true"
                 has-check-col="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !!itemCol.isFixed ">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth" fixed-width="tbStyle.scrollLeft"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.curRow}"
                                ng-click="selectRow($index)">
                                <td class="spill-dots border-l-none" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                    <button class="btn btn-operate m-r-xs"
                                        ng-click="handleEntryInfo(item)"
                                        ng-disabled="!btnPermission.logisticStatusEnterRecord||item.shippingMethodId=='0004'||item.shippingMethodId=='0007'||item.logisticStatus>2"
                                        title="{{!btnPermission.logisticStatusEnterRecord?'无权限执行此操作':''}}">录入物流信息</button>
                                    <button class="btn btn-operate"
                                        ng-click="handleSign(item)"
                                        ng-disabled="!btnPermission.logisticStatusSign||item.logisticStatus!=3"
                                        title="{{!btnPermission.logisticStatusSign?'无权限执行此操作':''}}">签收</button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-class="{'row-selected': $index === markInfo.curRow}"
                                ng-click="selectRow($index)">
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed" title="{{item[itemCol.dataField]}}">

                                    <span ng-if="!itemCol.clickFn">{{item[itemCol.dataField]}}</span>
                                    <a ng-if="!!itemCol.clickFn" class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)">
                                        {{item[itemCol.dataField]}}
                                    </a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="录入物流信息" active="activeFlag[1]" ng-if="activeFlag[1]">
            <div class="pos-a-full shuttle-box left" style="top: 35px; right: 60%;">
                <div class="box-head wrapper-none">
                    <div class="panel-bar clearfix m-t">
                        <div class="pull-left">
                            <i></i>基本信息
                        </div>
                    </div>
                </div>
                <div class="pos-a box-body wrapper-y-sm">
                    <div class="form-group col-xs-12 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">物流运单号：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.wayBillNo || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-12 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">客户名称：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.dealerOrgName || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-12 m-b-sm" ng-if="detailInfo.headInfo.businessType=='XGFJ'">
                        <label class="col-xs-4 m-b-n text-right max-w-100">发运交接单号：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.businessOrderNo || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-12 m-b-sm" ng-if="detailInfo.headInfo.businessType=='XGSC'">
                        <label class="col-xs-4 m-b-n text-right max-w-100">三包出库单号：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.businessOrderNo || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-12 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">单据类型：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.businessType|BusinessType}}
                        </div>
                    </div>
                    <div class="form-group col-xs-12 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">物流状态：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.logisticStatus|ProgressStatus:'logisticStatus'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-12 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">发运方式：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.shippingMethod || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-12 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">承运商：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.carrierOrgName || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-12 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">数量：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.amount || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-12 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">木箱规格：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.xx || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-12 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">收货人：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.receiverName || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-12 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">联系电话：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.receiverTel || '-'}}
                        </div>
                    </div>
                </div>
            </div>

            <div class="pos-a-full shuttle-box right" style="top: 35px; left: 40%;">
                <div class="box-head p-r-none">
                    <div class="panel-bar clearfix m-t">
                        <div class="pull-left">
                            <i></i>物流信息录入
                        </div>
                    </div>
                </div>
                <div class="pos-a box-body wrapper-y-sm" style="right:0;">
                    <div yb-time-line ng-model="logisticNodes" can-enter="true" can-not-receive="!btnPermission.logisticStatusArrival"
                         time-frame-new="logisticsNew" enter-func="entryLogistics()" receive-func="receiveGoods()"></div>
                </div>
            </div>
        </div>
        <div tab heading="详情" active="activeFlag[2]" ng-if="activeFlag[2]">
            <div>
                <div class="panel-bar clearfix">
                    <div class="pull-left">
                        <i></i>基本信息
                    </div>
                </div>
                <div class="m-t-sm form-up-tb clearfix">
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">物流运单号：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{detailInfo.headInfo.wayBillNo || '-'}}">
                            {{detailInfo.headInfo.wayBillNo || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">客户名称：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.dealerOrgName || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm" ng-if="detailInfo.headInfo.businessType=='XGFJ'">
                        <label class="col-xs-4 m-b-n text-right max-w-100">发运交接单号：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{detailInfo.headInfo.businessOrderNo || '-'}}">
                            {{detailInfo.headInfo.businessOrderNo || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm" ng-if="detailInfo.headInfo.businessType=='XGSC'">
                        <label class="col-xs-4 m-b-n text-right max-w-100">三包出库单号：</label>
                        <div class="col-xs-8 wrapper-none spill-dots" title="{{detailInfo.headInfo.businessOrderNo || '-'}}">
                            {{detailInfo.headInfo.businessOrderNo || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">单据类型：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.businessType|BusinessType}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">物流状态：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.logisticStatus|ProgressStatus:'logisticStatus'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">发运方式：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.shippingMethod || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">承运商：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.carrierOrgName || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">数量：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.amount || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">木箱规格：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.xx || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">收货人：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.receiverName || '-'}}
                        </div>
                    </div>
                    <div class="form-group col-xs-3 m-b-sm">
                        <label class="col-xs-4 m-b-n text-right max-w-100">联系电话：</label>
                        <div class="col-xs-8 wrapper-none spill-dots">
                            {{detailInfo.headInfo.receiverTel || '-'}}
                        </div>
                    </div>
                </div>
            </div>
            <div tabset type="sub-tab">
                <div tab heading="关联单据" active="subTabFlag[0]" ng-click="showSync=false;">
                    <div class="main-area d-b-60" style="top:210px;">
                        <div yb-table-fixed class="table-fixed-wrap">
                            <div class="th-scroll-x">
                                <table class="table-fixed border-none" width="100%">
                                    <thead>
                                        <tr>
                                            <th>业务单号</th>
                                            <th>销售单号</th>
                                            <th>采购单号</th>
                                            <th>备注</th>
                                        </tr>
                                    </thead>
                                </table>
                            </div>
                            <div class="td-scroll">
                                <table class="table-fixed border-none" width="100%">
                                    <tbody>
                                        <tr ng-repeat="item in detailInfo.linkBills track by $index">
                                            <td class="spill-dots" title="{{item.businessOrder}}">{{item.businessOrder}}</td>
                                            <td class="spill-dots" title="{{item.saleBillNo}}">{{item.saleBillNo}}</td>
                                            <td class="spill-dots" title="{{item.purchaseNo}}">{{item.purchaseNo}}</td>
                                            <td class="spill-dots" title="{{item.remark}}">{{item.remark}}</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div tab heading="关联单据详情" active="subTabFlag[1]" ng-click="showSync=false;">
                    <div class="main-area d-b-60" style="top:210px;">
                        <div yb-table-fixed class="table-fixed-wrap">
                            <div class="th-scroll-x">
                                <table class="table-fixed border-none" width="100%">
                                    <thead>
                                        <tr>
                                            <th>零件号</th>
                                            <th>零件中文名</th>
                                            <th>数量</th>
                                            <th>单据号</th>
                                        </tr>
                                    </thead>
                                </table>
                            </div>
                            <div class="td-scroll">
                                <table class="table-fixed border-none" width="100%">
                                    <tbody>
                                        <tr ng-repeat="item in detailInfo.linkBillDetails track by $index">
                                            <td class="spill-dots" title="{{item.materailsNo}}">{{item.materailsNo}}</td>
                                            <td class="spill-dots" title="{{item.materialsDesc}}">{{item.materialsDesc}}</td>
                                            <td class="spill-dots" title="{{item.amount}}">{{item.amount}}</td>
                                            <td class="spill-dots" title="{{item.businessOrder}}">{{item.businessOrder}}</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div tab heading="物流信息" active="subTabFlag[2]" ng-click="showSync=true;handleClickLogistics();">
                    <div class="main-area d-b-60" style="top:210px;">
                        <div yb-table-fixed class="table-fixed-wrap">
                            <div class="th-scroll-x">
                                <table class="table-fixed border-none" width="100%">
                                    <thead>
                                        <tr>
                                            <th width="140">时间</th>
                                            <th width="140">物流状态</th>
                                            <th>物流信息</th>
                                            <th>签收人</th>
                                        </tr>
                                    </thead>
                                </table>
                            </div>
                            <div class="td-scroll">
                                <table class="table-fixed border-none" width="100%">
                                    <tbody>
                                        <tr ng-repeat="item in logisticNodes track by $index">
                                            <td class="spill-dots" title="{{item.createDate|YbDate:'yyyy-MM-dd HH:mm:ss'}}" width="140">{{item.createDate|YbDate:'yyyy-MM-dd HH:mm:ss'}}</td>
                                            <td class="spill-dots" title="{{item.nodeType|ProgressStatus:'logisticStatus'}}" width="140">{{item.nodeType|ProgressStatus:'logisticStatus'}}</td>
                                            <td class="spill-dots" title="{{item.address}}">{{item.address}}</td>
                                            <td >                               
                                               <!-- <div ng-click="viewImage(item.signImg)" class="pull-left img-container" ng-if="item.signImg">
                                                    <img ng-src="{{item.signImg}}"/>
                                                </div> -->
                                                <span  class="img-container" ng-click="viewImage(item.signImg)" style="border: 0px;">
                                                    <img ng-src="{{item.signImg}}"   />
                                                </span>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <a style="margin-left:18px;margin-top: 6px;display:inline-block;color:#0071ff;"
                    ng-if="needShowSync&&showSync"
                    ng-click="syncLogistics()"
                    ng-disabled="!btnPermission.logisticStatusSync"
                    title="{{!btnPermission.logisticStatusSync?'无权限执行此操作':''}}">同步</a>
            </div>
            <div class="bottom-area btn-bar text-center border-t clearfix">
                <button type="button" class="btn btn-default" ng-click="changeTab(0)">取消</button>
            </div>
        </div>
    </div>
</div>